import TestContext from '../../store/TestContext';
import React,{useContext} from 'react';
const MyComponent = () => {
    // 使用钩子函数useContext 只适用函数组件
const xxx = useContext(TestContext)
    return (
          <>{xxx.name}- {xxx.age}</>
    );
};

export default MyComponent;